package com.happystreet.config
{
	/**
	 *部件配置 ->Parts.xml
	 * @author Liseen
	 * 
	 */	
	public class PartsConfig
	{
		public static var partsConfig:XML;
		public function PartsConfig()
		{
			throw (new Error("PartsConfig: this class can't be instantiated."));
		}
		/**
		 *设置部件配置 
		 * @param data
		 * 
		 */		
		public static function setPartsConfig(data:String):void
		{
			partsConfig = new XML(data);
		}
		/**
		 *通过部件id获取元件名 
		 * @param part_id
		 * @return 
		 * 
		 */		
		public static function getSymbolNameById(part_id:int):String
		{
			return String(partsConfig..part.(@id == part_id).@symbol);
		}
		/**
		 *通过部件id获取部件类型名
		 * @param part_id
		 * @return 
		 * 
		 */		
		public static function getNameById(part_id:int):String
		{
			return String(partsConfig..part.(@id == part_id).@name);
		}
	}
}